﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using netDxf;
using netDxf.Blocks;
using netDxf.Collections;
using netDxf.Entities;
using netDxf.Header;
using netDxf.Objects;
using netDxf.Tables;
using netDxf.Units;
using static netDxf.Entities.HatchBoundaryPath;

//using static netDxf.Entities.HatchBoundaryPath;
using Attribute = netDxf.Entities.Attribute;
using Image = netDxf.Entities.Image;
using Point = netDxf.Entities.Point;
using Trace = netDxf.Entities.Trace;

namespace TestDxfDocument
{
    class funbit

    {

        public static void Hexagonalblade(DxfDocument dxf, Vector2 p1, double radius, double ang1, netDxf.Tables.Layer layercolor)  //六边形刀片
        {
            double pi = Math.PI;
            double l = radius / Math.Tan(80 * pi / 180) + radius / Math.Tan(40 * pi / 180);
            Vector2 p2 = fun.Polar(p1, pi / -2 + ang1, radius / Math.Sin(80 * pi / 180));
            Vector2 p3 = fun.Polar(p2, pi - 10 * pi / 180 + ang1, l);
            Vector2 p4 = fun.Polar(p3, 70 * pi / 180 + ang1, l);
            Vector2 p5 = fun.Polar(p4, 50 * pi / 180 + ang1, l);
            Vector2 p6 = fun.Polar(p5, -50 * pi / 180 + ang1, l);
            Vector2 p7 = fun.Polar(p6, -70 * pi / 180 + ang1, l);
            var polyline1 = Pus.AddPointsToLwPolyLine(p2, p3, p4, p5, p6, p7, p2);
            fun.PolyFill(dxf, polyline1, 0.5, layercolor);



        }
    }
}